//
//  LYZRecommendUserCell.m
//  01-百思不得姐
//
//  Created by 李昱铮 on 16/8/26.
//  Copyright © 2016年 LYZ. All rights reserved.
//

#import "LYZRecommendUserCell.h"
#import "LYZRecommendUser.h"
#import <UIImageView+WebCache.h>

@interface LYZRecommendUserCell ()
@property (weak, nonatomic) IBOutlet UIImageView *headerImageView;
@property (weak, nonatomic) IBOutlet UILabel *screenNameLable;
@property (weak, nonatomic) IBOutlet UILabel *fansCountLable;
@end

@implementation LYZRecommendUserCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setUser:(LYZRecommendUser *)user
{
    _user = user;
    
    self.screenNameLable.text = user.screen_name;
    
    NSString * fansCount = nil;
    if (user.fans_count < 10000)
    {
        fansCount = [NSString stringWithFormat:@"%zd人关注",user.fans_count];
    }
    else
    {
        fansCount = [NSString stringWithFormat:@"%.1f万人关注",user.fans_count / 10000.0];
    }
    
    self.fansCountLable.text = fansCount;
    [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:user.header] placeholderImage:[UIImage imageNamed:@"defaultUserIcon"]];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
